//
//  NSObject+JRSimpleKVO.h
//  SimpleKVO
//
//  Created by 丁嘉睿 on 2017/6/1.
//  Copyright © 2017年 achen. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface NSObject (JRSimpleKVO) 

void import_NSObject_JRSimpleKVO_Compression (void);


/** -------- Add --------- */


/**
 添加kvo 注：options = NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld

 @param path keyPath
 @param block block
 */
- (void)addKVOForPath:(NSString *)path withChangeBlock:(void (^)(NSDictionary<NSKeyValueChangeKey,id> *change))block;

/**
 添加kvo 注：options = NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld

 @param paths keyPaths
 @param block block
 */
- (void)addKVOForPaths:(NSArray <NSString *>*)paths withChangeBlock:(void (^)(NSDictionary<NSKeyValueChangeKey,id> *change, NSString *keyPath))block;

/**
 添加kvo

 @param path keyPath
 @param options NSKeyValueObservingOptions
 @param block block
 */
- (void)addKVOForPath:(NSString *)path options:(NSKeyValueObservingOptions)options withChangeBlock:(void (^)(NSDictionary<NSKeyValueChangeKey,id> *change))block;

/**
 添加kvo

 @param paths keyPaths
 @param options NSKeyValueObservingOptions
 @param block block
 */
- (void)addKVOForPaths:(NSArray <NSString *>*)paths options:(NSKeyValueObservingOptions)options withChangeBlock:(void (^)(NSDictionary<NSKeyValueChangeKey,id> *change, NSString *keyPath))block;


/** -------- Remove --------- */
/**
 移除对象所有kvo
 */
- (void)removeAllKVOs;

- (void)removeKVOForPaths:(NSArray <NSString *>*)paths;

/**
 移除对象pathkvo

 @param path keyPath
 */
- (void)removeKVOForPath:(NSString *)path;
@end
